package nothing.dao.hibernate;

import nothing.model.FoodType;
import nothing.dao.FoodTypeDao;
import org.appfuse.dao.hibernate.GenericDaoHibernate;

import java.util.List;

public class FoodTypeDaoHibernate extends GenericDaoHibernate<FoodType, Long> implements FoodTypeDao {

    public FoodTypeDaoHibernate() {
        super(FoodType.class);
    }

    @SuppressWarnings("unchecked")
    public List findByFoodName(String name) {
        return getHibernateTemplate().find("from FoodType ft, Food f where ft.food=f and f.name=?", name);
    }
}

